﻿@model Dinamico.Models.ContentPart

@{ Content.Define(re =>
	   {
           re.Title = "Dynamic Search ";
       });
       }
@{ Html.Resources().JavaScript("~/Scripts/customNative.js"); }
@{ Html.Resources().JavaScript("~/Scripts/zoom.js"); }

<div style="text-align: center; border: 1px solid; border-top: 0px; border-left: 0px; border-right: 0px;"  >
                            <div style="background-image: url(/Upload/Images/category/searchBack.png); width: 302px; height: 80px; position: absolute; z-index: 10; margin-left: 120px; margin-top: 100px; display: table;">
                                <div style="display: table-cell; vertical-align: middle;">
                                    <label for="suchfeld" style="">Produktsuche:</label><br />
                                    <input type="text" id="suchfeld" name="term" value="" />
                                    <input type="button" name="absenden" id="searchButton" class="suchbutton" value="Suche" />
                                </div>
                            </div>
                            <div class="standard"  id="cookiecontainer" >  
                        </div>
                        </div>

<div class="standard" id="maincontainer"></div>
<script type="text/javascript" language="javascript">
    jQuery(document).ready(function () {
        var dataIndex = 0;
        var i = 0;
        var term = null;
        
        try {
            loadFromCookie();
        }
        catch (Error) { }
        var searchObj = new SearchObj();
        $('#searchButton').click(searchObj.click2);
        $("#suchfeld").keyup(function (event) { searchObj.enterPressed(event) });
        // var cookies = document.cookies;
    });
    
    $(window).scroll(function () {
        term = $("#suchfeld").val();
        if ($.browser.mozilla) {
            if ($(document).height() - $(window).scrollTop() <= $(window).height() + 1) {
                searchObj.printContent(term, 10);
            }
        }
        else {
            if ($(window).scrollTop() >= $(document).height() - $(window).height() - 1) {
                searchObj.printContent(term, 10);
            }
        }
    });
</script>